Repository navigation
borealis: share compute derivatives, float32 atomics, D16S8, and ASTC HDR across all chips - #929
Conversation
… HDR across all chips Remove qualification-only chip gates for shared NIR shader capabilities and hardware image formats supported across all Apple Silicon GPU generations (G13-G17): - VK_KHR_compute_shader_derivatives: lowered in NIR via quad swaps and explicit-gradient texture operations; drive shader preprocessing directly from supported_features.computeDerivativeGroupQuads and properties.meshAndTaskShaderDerivatives. - VK_EXT_shader_atomic_float and VK_EXT_shader_atomic_float2: lowered via agx_nir_lower_atomics() (CAS loops on AGX2/AGX3C, native fp32 add + CAS on AGX3B); key R32_FLOAT storage image and texel buffer atomic format features directly on supported_features.shaderImageFloat32Atomics. - VK_FORMAT_D16_UNORM_S8_UINT: backed by independent Z16 and S8 planes in ZLS and depth/stencil aspect meta copies across all generations. - VK_EXT_texture_compression_astc_hdr: supported by Apple Silicon texture units from G13 onward with existing ASTC float format mappings. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Exact-head
+105 NS -> Pass, 0 Fail, 0 GPU faults, 0 AVCs, SELinux Enforcing, 0 failed units. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Source review of exact head 6ce015f76154. No defect.
Checked.
- Every feature bit now follows its extension: the
shader*Float32Atomic*add and min/max bits,computeDerivativeGroup{Quads,Linear}andtextureCompressionASTC_HDR. The 64-bit, 16-bit and sparse variants stay false. - The
R32_FLOATimage and texel-buffer atomic format bits followshaderImageFloat32Atomics. Image atomics are still refused on linear tiling. hk_preprocess_nir()now lowers compute derivatives fromsupported_features.computeDerivativeGroupQuads, and task/mesh derivatives frommeshAndTaskShaderDerivatives, so the lowering runs exactly where the feature is advertised. No existing shader-cache entry is affected: before this change, no shader with a derivative group could be created on the newly enabled chips.- The late per-chip overrides in
hk_create_drm_physical_device()are gone, so the static table is now the single source of truth.
Notes, not blocking:
- ASTC HDR on AGX2. The PR body says ASTC HDR is supported by the texture hardware "from G13 onward". The J413 row covers G14 only: 12/72 pass, and the other 60 cases are not supported. Please add the queued J316s (G13) row. It is the one that shows G13 decodes HDR blocks correctly rather than falling back. Include a sampled-value case such as
dEQP-VK.texture.compressed.astc_*_hdr*if the caselist has one, and not only format-property queries. - D16S8 on AGX2. The rows exercise the format through CTS groups, but D16S8 is new on G13/G14/G15/G16. A depth/stencil resolve and copy subset would cover the split-plane meta paths that D32S8 already exercises on those chips:
dEQP-VK.renderpass2.depth_stencil_resolve.*d16_unorm_s8_uint*anddEQP-VK.api.copy_and_blit.*d16_unorm_s8_uint*. - The M5 ASTC HDR row listed under Still to run is still outstanding.
|
Follow-up receipts at exact head
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Review of aurora-silicon/mesa#929 at exact head 6ce015f7615407fe191b065916f3459684e1fbc7.
Summary
The gate removals for float32 atomics, VK_FORMAT_D16_UNORM_S8_UINT, and VK_EXT_texture_compression_astc_hdr are clean and match the underlying lowering and hardware tables, and the J316s/J413/J713/Neo receipts look solid. However, enabling VK_KHR_compute_shader_derivatives on AGX2 (G13/G14) exposes an unlowered OpImageQueryLod (textureQueryLod) path in descriptor lowering, and the G15 / M5 hardware receipts listed under "Still to run" are still pending.
Blocking Findings
-
Correctness (§3):
OpImageQueryLod(textureQueryLod) in compute shaders is unlowered on AGX2 (G13/G14)src/asahi/vulkan/hk_physical_device.c:192and1101-1104advertiseVK_KHR_compute_shader_derivatives(computeDerivativeGroupQuadsandcomputeDerivativeGroupLinear) across all generations, including G13 (descriptor_generation == 7) and G14 (descriptor_generation == 8).agx_nir_lower_compute_derivatives()(src/asahi/compiler/agx_nir_lower_compute_derivatives.c:76) only lowersnir_texop_texandnir_texop_txbtonir_texop_txd. Computenir_texop_lod(OpImageQueryLod) is handled separately bylower_compute_lod_query()insrc/asahi/vulkan/hk_nir_lower_descriptors.c:1238-1247.lower_compute_lod_query()currently bails out unlessctx->descriptor_generationis 9 or 10 (hk_nir_lower_descriptors.c:1244), so on G13 (Gen 7) and G14 (Gen 8) computenir_texop_lodskips software quad-derivative LOD lowering and falls through to hardwareAGX_LOD_MODE_AUTO_LOD+query_lod(src/asahi/compiler/agx_compile.c:9005,9349,src/asahi/compiler/agx_pack.c:906), where compute dispatches have no hardware fragment-quad derivatives.- Required fix: Add AGX2 (Gen 7/8) sampler-descriptor decoding to
lower_compute_lod_query()(unbiasing the AGX2sampler_index, reading the 8-byte AGX2 sampler heap entry viaroot.sampler_heap_addressforminimum_lod/maximum_lod/mip_filter, and loadinglod_bias_fp16fromnative.lod_bias), and include computetextureQueryLodCTS coverage on G13/G14.
-
Hardware evidence (§5): remaining claimed generations still pending
- Exact-head receipts are in for J316s (G13X), J413 (G14G), J713 (G16G), and Neo (G17P), including the follow-up sampled 2D ASTC HDR and D16S8 copy/blit checks on J316s/J413 (0 GPU faults, 0 AVCs, Enforcing, 0 failed units).
- Still needed at the final head SHA:
- G15 (M3) exact-head CTS row (needed to verify both AGX3B native device
AGX3_ATOMIC_FADDviaagx_nir_lower_atomics(nir, byte_indices)and the Gen 9 / Gen4-samplerlower_compute_lod_query()path on G15). - M5 (HAL300) exact-head
VK_EXT_texture_compression_astc_hdrverification row. - G13/G14 (AGX2) exact-head compute
OpImageQueryLodverification once blocker #1 is fixed.
- G15 (M3) exact-head CTS row (needed to verify both AGX3B native device
Non-Blocking Notes
- Overlap with open PR #923: The PR body states zero overlap with active PRs, but open PR #923 (
borealis: take float image atomics, colour pruning and position order to G16G) modifies the same hunks insrc/asahi/vulkan/hk_buffer_view.c:79-84andsrc/asahi/vulkan/hk_image.c:230-238. Please coordinate merge order or rebase cleanly once one lands. - Minor (
src/asahi/vulkan/hk_shader.c:566):lower_compute_derivativesgatesMESA_SHADER_COMPUTEonvk_pdev->supported_features.computeDerivativeGroupQuadseven whennir->info.derivative_group == DERIVATIVE_GROUP_LINEAR. Checkingvk_pdev->supported_extensions.KHR_compute_shader_derivatives(or matching theQuads/Linearfeature bit tonir->info.derivative_group) avoids coupling the two modes.
Checklist & CI Verification (6ce015f7615407fe191b065916f3459684e1fbc7)
- §1 No model gating: Pass on diff (removes legacy chip gates in favor of extension/feature/property bits; no new chip gates introduced).
- §2 Production-ready: Pass (no new env vars, cmdline flags, or workarounds).
- §3 Safety & correctness: Changes requested — blocker #1 above for AGX2 compute
OpImageQueryLod. The other three capabilities are verified sound:- Float32 atomics: only 32-bit float buffer/shared/image atomics are exposed (16-bit, 64-bit, sparse stay
false); image/texel-buffer atomics lower vianir_lower_image_atomics_to_global(agx_nir_lower_texture.c:2264) beforeagx_nir_lower_atomics(nir, byte_indices)(agx_compile.c:10724), using bitwisenir_ieqCAS loops on AGX2/AGX3C and nativeAGX3_ATOMIC_FADD+ CAS on AGX3B; linear storage images remain excluded. D16_UNORM_S8_UINT: splitZ16_UNORM+S8_UINTplanes are wired acrosshk_image.h,hk_image.c,hk_image_view.c,hk_cmd_draw.c,agx_helpers.h,hk_cmd_clear.c, andhk_cmd_meta.c.ASTC HDR:src/asahi/layout/formats.c:248-261carries all 14ASTC_*_FLOATentries,hk_image_view.c:325-326passeschannels/typedirectly, and AGX3/M5 block copies already classifyHK_G17P_BLOCK_FORMAT_ASTC_HDR.
- Float32 atomics: only 32-bit float buffer/shared/image atomics are exposed (16-bit, 64-bit, sparse stay
- §4 Clean-room & attribution: Pass (
Ryan Murray <ryan@aurorasilicon.org>author/committer +Signed-off-by, clean commit and PR text). - §5 Evidence & CI: Incomplete (G15, M5 ASTC HDR, and AGX2 compute
OpImageQueryLodpending).statusCheckRolluponaurora-silicon/mesa#929is empty; mirror CI at exact head6ce015f76154(ci/train-pr929) passedaurora-agent-policyandasahi(build-test). - §6 Naming: Pass (Borealis used consistently in commit and PR prose).
…group mode Add AGX2 (descriptor generations 7 and 8) sampler decoding to lower_compute_lod_query() by unbiasing the AGX2 sampler index, reading the 8-byte sampler heap entry via root.sampler_heap_address for min_lod/max_lod/mip_filter, and loading lod_bias_fp16 from native.lod_bias. Match compute derivative preprocessing in hk_preprocess_nir() to the active derivative_group mode (quads vs linear), and keep VK_EXT_texture_compression_astc_hdr scoped to non-HAL300 chips until qualified on M5 hardware. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Addressed all review items in exact head
Exact-head
|
| Machine (Chip / Kernel) | compute_querylod (223) |
atomic_float (76) |
d16s8 (72) |
astc_hdr (72) |
control |
Health |
|---|---|---|---|---|---|---|
J316s (M1 Pro G13X, fleet87) |
191 Pass / 0 Fail (base 8, +183) | 24 Pass / 0 Fail | 49 Pass / 0 Fail | 12 Pass / 0 Fail | 87/96 Pass, 0 Fail | 0 GPU faults, 0 AVCs, Enforcing, 0 failed units |
J413 (M2 Air G14G, fleet87) |
191 Pass / 0 Fail (base 8, +183) | 24 Pass / 0 Fail | 49 Pass / 0 Fail | 12 Pass / 0 Fail | 87/96 Pass, 0 Fail | 0 GPU faults, 0 AVCs, Enforcing, 0 failed units |
J615 (M3 Air G15G, fleet85) |
190 Pass / 0 Fail (base 7, +183) | 52 Pass / 0 Fail | 52 Pass / 0 Fail | 12 Pass / 0 Fail | 96/96 Pass, 0 Fail | 0 GPU faults, 0 AVCs, Enforcing, 0 failed units |
J713 (M4 Air G16G, fleet85) |
190 Pass / 0 Fail (base 7, +183) | 52 Pass / 0 Fail | 52 Pass / 0 Fail | 12 Pass / 0 Fail | 95/95 Pass, 0 Fail | 0 GPU faults, 0 AVCs, Enforcing, 0 failed units |
Neo (A18 Pro G17P, fleet87, reg) |
216 Pass / 0 Fail (0 reg) | 52 Pass / 0 Fail | 53 Pass / 0 Fail | 12 Pass / 0 Fail | 96/96 Pass, 0 Fail | 0 GPU faults, 0 new AVCs, Enforcing, 0 failed units |
- Evidence:
traces/gpu/20261124-neon-gpu-features/wave3-{m1pro-g13x,m2-g14g,j615-g15g,j713-g16g,neo-g17p}/.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 02590f319cf6
Blockers: none
Checked:
- §1 No model gating: Pass — removes legacy chip gates for
VK_KHR_compute_shader_derivatives,VK_EXT_shader_atomic_float{,2},R32_FLOATimage/texel-buffer atomics, andVK_FORMAT_D16_UNORM_S8_UINT; widensVK_EXT_texture_compression_astc_hdrfrom G17P-only to!agx_chip_hal300_path(dev->chip)with commit justification (549a9f8dce1f) until M5 hardware is measured. - §2 Production-ready: Pass — no new cmdline flags, env vars, or workarounds;
hk_preprocess_nir()now matchesDERIVATIVE_GROUP_QUADSvsDERIVATIVE_GROUP_LINEARdirectly. - §3 Safety & correctness: Pass — prior AGX2 compute
OpImageQueryLodblocker is resolved insrc/asahi/vulkan/hk_nir_lower_descriptors.c:1244-1297(Gen 7/8HK_SAMPLER_AGX2_BIASunbias with underflow guard, 8-byte sampler heap lookup viaroot.sampler_heap_address,native.lod_biasfp16 load, bit layout matchingcmdbuf.xmlSamplerbits 0..9 / 10..19 / 27..28). Mergeable cleanly onto currentaurora-wip. - §4 Clean-room & attribution: Pass — all 3 commits carry human author/committer (
Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:; clean commits and PR text. - §5 Evidence & CI: Pass — exact-head
02590f319cf6mirror CI green (asahirun45392079291+aurora-agent-policyrun45392079333) and exact-head CTS receipts pass across all 5 enabled generations (G13X, G14G, G15G, G16G, G17P regression) with 0 Fail, 0 GPU faults, 0 AVCs, Enforcing, 0 failed units. - §6 Naming: Pass — Borealis used consistently across commits and PR text.
Evidence
- Exact head verified:
02590f319cf6a41b632209dd72f117b0db90f3d5(MERGEABLEvsaurora-wip). - Prior
CHANGES_REQUESTED(6ce015f76154) resolution:src/asahi/vulkan/hk_nir_lower_descriptors.c:1244-1297: addedhk_descriptor_generation_is_agx2()path tolower_compute_lod_query().src/asahi/vulkan/hk_shader.c:591-601: matched compute derivative lowering tocomputeDerivativeGroupQuadsvscomputeDerivativeGroupLinear.src/asahi/vulkan/hk_physical_device.c:366-368: scopedEXT_texture_compression_astc_hdrto!agx_chip_hal300_path(dev->chip); clean forward-merge ontoaurora-wip.
- CI (exact head
02590f319cf6a41b632209dd72f117b0db90f3d5):- Mirror
DjDeveloperr/mesaci/train-pr929:asahi(build-test, 45392079291) PASS;aurora-agent-policy(policy, 45392079333) PASS. - Host
meson test --suite asahi: 256/256 PASS.
- Mirror
- Hardware matrix (exact head
02590f319cf6,libvulkan_asahi.sosha256e349a3795e058d47..., all 0 GPU faults / 0 AVCs / Enforcing / 0 failed units):- J316s (M1 Pro G13X,
fleet87):compute_querylod191/223 (+183),atomic_float24/76,d16s849/72,astc_hdr12/72,control87/96 (0 Fail). - J413 (M2 Air G14G,
fleet87):compute_querylod191/223 (+183),atomic_float24/76,d16s849/72,astc_hdr12/72,control87/96 (0 Fail). - J615 (M3 Air G15G,
fleet85):compute_querylod190/223 (+183),atomic_float52/76,d16s852/72,astc_hdr12/72,control96/96 (0 Fail). - J713 (M4 Air G16G,
fleet85):compute_querylod190/223 (+183),atomic_float52/76,d16s852/72,astc_hdr12/72,control95/95 (0 Fail). - Neo (A18 Pro G17P,
fleet87, regression):compute_querylod216/223 (0 reg),atomic_float52/76,d16s853/72,astc_hdr12/72,control96/96 (0 Fail).
- J316s (M1 Pro G13X,
- Non-blocking note: Open PR #923 touches overlapping hunks in
hk_buffer_view.candhk_image.c(coordinate rebase order once either lands).
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: post-merge review of the final head (merged after DjDeveloperr's re-review). I found no defect. My earlier review was at the previous head; this pass covers only what changed since.
Checked:
- AGX2 compute
OpImageQueryLod(lower_compute_lod_query, merged23c96bcf). It reads the published 16-bit sampler index, removesHK_SAMPLER_AGX2_BIAS(28) and loads the sampler word from the root sampler heap at 8 bytes per element. That is the AGX2 heap element size fromagx_chip_sampler_heap_element_size(), keyed on the command-stream generation, not a chip id. The load isload_speculatable, so a bad index cannot fault. - The derivative-group condition still requires a workgroup stage and
derivative_group != NONE, so fragment LOD queries are unchanged.
Question (not blocking): for published < 28 the NIR selects heap index 0, while the host helper hk_sampler_heap_index() returns UINT16_MAX (no heap sampler) in the same case. If an index below the bias can reach this path (an internal or immutable sampler slot), the LOD query clamps with sampler 0's LOD range instead of the real one. Either assert that it can't happen, or treat it like the host helper (skip the clamp, or use the API-only bias). CTS dEQP-VK.glsl.texture_functions.query.lod.* in a compute derivative group on J316s/J413 would show it.
For the final mesa#931 head, !is_virtio replaces the old G17P and native-AGX3 tests in the WSI cgroup bound, AGX_BO_NO_CACHE for WSI allocations and the export-failure return. Those are hardware-path properties, not chip gates. Export failure now returns VK_ERROR_OUT_OF_HOST_MEMORY everywhere off virtio instead of VK_SUCCESS with a negative fd, which fixes a real bug on AGX2 and G15/G16. vs_covers_clip_square widening to agx_chip_native_or_m5 matches the AGX3 VDM behaviour the comment describes.
Problem
Four shared NIR shader and hardware format capabilities in Borealis remained gated to G17P and/or M5 even though the underlying lowering and hardware format support are present across all Apple Silicon GPU generations (G13-G17):
VK_KHR_compute_shader_derivatives(computeDerivativeGroupQuads/computeDerivativeGroupLinear): lowered in NIR via quad swaps and explicit-gradient texture ops (agx_nir_lower_compute_derivatives), already supported on AGX2 and AGX3.VK_EXT_shader_atomic_floatandVK_EXT_shader_atomic_float2(plusR32_FLOATstorage image & texel buffer atomics): lowered inagx_nir_lower_atomics()via 32-bit integer CAS loops on AGX2/AGX3C and native FP32fadd+ CAS on AGX3B.VK_FORMAT_D16_UNORM_S8_UINT: backed by independent Z16 and S8 planes in ZLS and split depth/stencil meta copies across all generations.VK_EXT_texture_compression_astc_hdr: supported in hardware by Apple Silicon texture units from G13 onward with existing ASTC float format mappings insrc/asahi/layout/formats.c.Supersedes the earlier draft Airs-only subset in #816 and extends full coverage cleanly to AGX2 (G13/G14), native AGX3 (G15/G16/G17P), and M5 without adding chip gates.
Change
VK_KHR_compute_shader_derivatives,VK_EXT_shader_atomic_float,VK_EXT_shader_atomic_float2,VK_EXT_texture_compression_astc_hdr, andVK_FORMAT_D16_UNORM_S8_UINTuniformly across all Borealis generations.hk_preprocess_nir()directly fromvk_pdev->supported_features.computeDerivativeGroupQuadsandvk_pdev->properties.meshAndTaskShaderDerivativesinstead of chip-ID checks.R32_FLOATstorage image and texel buffer atomic format feature bits inhk_image.candhk_buffer_view.cdirectly onsupported_features.shaderImageFloat32Atomicsinstead ofagx_chip_g17p_or_m5().#824,#810,#812,#813,#416,#456.Testing
Exact head
6ce015f76154(arm64 ICDlibvulkan_asahi.sosha256a2f7d4bfddaf20ad...vsaurora-wip912c9e4cc7esha25618224556d3f83964..., userspace-only viaVK_DRIVER_FILES, 0 GPU faults, 0 new AVCs, Enforcing, 0 failed units):meson test --suite asahi245/245 PASS.fleet87):derivatives0 -> 20/72 Pass,atomic_float0 -> 24/76 Pass (compute/fragment buffer/shared/image/texel-buffer; remaining 28 requirevertexPipelineStoresAndAtomics),d16s80 -> 49/72 Pass,astc_hdr0 -> 12/72 Pass (+105 NS -> Pass, 0 Fail), control 87/96 identical.fleet85):derivatives0 -> 20/72 Pass,atomic_float0 -> 52/76 Pass,d16s80 -> 52/72 Pass,astc_hdr0 -> 12/72 Pass (+136 NS -> Pass, 0 Fail), control 95/95 identical.fleet87):derivatives72/72,atomic_float52/76,d16s853/72,astc_hdr12/72, control 96/96 — 100% identical, 0 regressions.Still to run
VK_EXT_texture_compression_astc_hdrverification row (the other three were already enabled on M5).Exact-head CTS matrix & environment receipts (6ce015f)
derivatives(72)atomic_float(76)d16s8(72)astc_hdr(72)control7.3.0-aurora-fleet87base7.3.0-aurora-fleet87b2(6ce015f7615)7.3.0-aurora-fleet85base7.3.0-aurora-fleet85b2(6ce015f7615)7.3.0-aurora-fleet87base7.3.0-aurora-fleet87b2(6ce015f7615)*J713
fleet85has one pre-existing baseline MSAA depth submit EINVAL (std_sample_locations.draw.depth), identical acrossbaseandb2; all other 95/95 control cases pass.ICD SHA-256:
base(912c9e4cc7e):18224556d3f839649cc03e525696211342944e49dc5b3b3d3efc8686a5d37797b2(6ce015f7615407fe191b065916f3459684e1fbc7):a2f7d4bfddaf20ad86bd91b7f4204b8d02f039683d19a7cf05485c4e7e89ecaf